home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
program
/
door_io.lha
/
door_io.library
/
door_io.doc
< prev
next >
Wrap
Text File
|
1995-09-05
|
4KB
|
88 lines
Hi there.. this is the Documentation ;) for the door_io.library.
I have written it for all BBS-Door programmers (me included).
It should be useful if one wants to input characters (a string) and react
on events in parallel. This is important for MultiUserDungeons (MUD) and
related things.. I used on in a not_really_MUD named Gore. Its more a
MUDSG .. multiuserdungeonspladdergame..
Well.. it is not very funny if you are typing in a command, and when you are done
with it getting a message "a level 4711 Zombie has shaved you with a chainsaw" :))
An other Thing is the metacharacterexpander (what a word ..)
a "#" is used as a control character. the following character tells what happens:
0 -> color black
1 -> color red
2 -> color green
3 -> color blue
4 -> color yellow
5 -> color magenta
6 -> color cyan
7 -> color white
n -> CR/LF
s -> standard colors
These packetio-routines were originally not a shared lib, but we wanted to use the
thing in a chatter-library (which will be soon available for AmBoS) and so
the door_io.library was born :)
The library and all associated stuff is copyright by A.Haarer 1995+ and it
may be freely used. It may be copied and spread on a non-profit basis.
Commercial use is prohibited without written permission by Author .. ME !! :-)
Hum.. btw this program is thingware.. you may send anything to anyone :)
_______________________________________________________________________________
Q: What is it for ???
A: Its a shared library that simplifies i/o operations in BBS-Cli-Doorprograms
- You are able to wait for Keys AND incoming exec-messages in parallel !
- You are able to specify a "carrier-lost-hook" to do cleanup when the line
breaks down
- it contains a metacharexpander which can generate colored output strings.
________________________________________________________________________________
Q: How does it work ?
A: The library does it's i/o operations by dospackets and therefore can wait()
for an input and other applicationspecific messages. The standard input() and
output() handles are used to determine the handler process.
_________________________________________________________________________________
Q: Why should i use it ? I can also poll the input stream !
A: - Because polling in a multitasking environment ist complete bullshit ;-))
- Polling does slow down the whole system and is bad design, if other solutions
are possible.
- If you are polling single characters, you have to build a string input yourself.
- polling suxx :)
_________________________________________________________________________________
Q: How do i use it ?
A: - Replace your string input function by BOX_getstr()
- Replace your string output function by BOX_getstr() and format the strings
with sprintf() when required.
- Initialize the opened Library with BOX_start() and supply some parameters
- meta_on 1 -> the "#" controls the colors of text output
0 -> the text output is not changed
- carrier_lost_hook (optional) is called when the handler returns an error
(this is standard in most common bbs programs)
- exthandler is called when one of the specified sigbits is set
- sigmask sigmask to trigger the exthandler
- modify the signal mask by BOX_setmask() when required
- Your carrier_lost_hook function should call BOX_stop() and close all resources of
your program
- YOU MUST DECLARE BOTH HOOKFUNCTIONS with __saveds OR EQUIVALENT !
(__saveds restores the near data pointer, for some compilers its __geta4)
- Call BOX_stop() when your program quits
_________________________________________________________________________________
Q: How contact the Author ?
A: - Email to MAC@nasus.north.de or MAC@dontpanic.sub.org
- Call the Castle of Confusion BBS : +49 421 636 7544 or +49 421 636 8643